RQPC: full FB, Masm, Gcc, ... in RapidQ Tiny Expand Messages Jacques Message 1 of 24 , Jan 1, 2007 View Source This is no New Year fool ! In RapidQ Tiny, it is possible to include *Full* Fast FB, Masm, Gcc, ... code (all keywords allowed). It is very easy to do with RQPC. RQPC handles MASM, GCC and FreeBasic providing that they are installed on your computer and RQPC.INI is adapted :) Doc Snip Here is the new GREAT magic. It will create a Tiny Header including your Masm/FB/Gcc functions and these functions will be automatically linked at Runtime with your RapidQ Code. Example: '' ---- Start of your FB Code file named "MyFB.Fbb" ' ''RQEXPORT function AddInt (i1, i2) Function AddInt (i1, i2, i3, i4) As Long Function = i1 + i2 End Function '' ---- end of your FB code '' ---- Start of your RapidQ code named MyRq.bas ''pre cmd console Tiny MyFB.Fbb Print AddInt (7, 8) ShowMessage ("Wait") '' ---- End of your RapidQ code Then you run RQPC.EXE MyRq.Bas And it will be DONE ! AddInt will be a FAST FB function with all FB keywords possible. Same for MASM and GCC. End Snip Get the alpha package (250K) at: http://www.teledisnet.be/web/jph01696/RapidQ/RQPC_01_01_2007_HNY.zip You should begin with ByteCode_Course/ByteCode_Course.Txt RQPC sources are not available for now, to much work to make them 'sortable'. All the Shells that will allow you to write your own RQPC are included with a doc. When RQPC creates an executable, ALL THE SOURCE CODE of your ececutable are generated when using MASM, GCC or FB. When using internal resource, no external compiler needed, you'll have to trust my 4K Masm compiled header included in your executable. I created a Group RapidQ_EX@yahoogroups.com were, I hope, you will report bugs. RapidQ_EX is by no mean designed to compete with this one, if it will, I will close it. It's just a place where to discuss topics too specific to be discussed here. Oh, I forgot, RQPC allows any Icon size to be added to your Tiny executable, it can count builds, ... Happy New Year, Jacques Reply paul ludgate Jan 26, 2007 View Source Hi Jacques, I finally got around to looking at RQPC and I am very impressed though I find it incredibly confusing. Like me, documentation isn't your strongest point. I've been working on a similar idea myself but nowhere near as powerful. Re Tiny launchers:- I see you allow for 1024 CommandLine arguments. RQ_Execute**** can only handle 256 so you can save some DATA space there. That is unless you want me to modify the DLLs. Personally, I'd have thought something like 32 was more than enough. I certainly can't remember ever using more than 8, even in DOS. Keep it up, Paul ____________________________________________________________________________________ It's here! Your new message! Get new email alerts with the free Yahoo! Toolbar. http://tools.search.yahoo.com/toolbar/features/mail/ Reply paul ludgate Jan 26, 2007 View Source Hi Jacques, I finally got around to looking at RQPC and I am very impressed though I find it incredibly confusing. Like me, documentation isn't your strongest point. I've been working on a similar idea myself but nowhere near as powerful. Re Tiny launchers:- I see you allow for 1024 CommandLine arguments. RQ_Execute**** can only handle 256 so you can save some DATA space there. That is unless you want me to modify the DLLs. Personally, I'd have thought something like 32 was more than enough. I certainly can't remember ever using more than 8, even in DOS. Keep it up, Paul ____________________________________________________________________________________ Cheap talk? Check out Yahoo! Messenger's low PC-to-Phone call rates. http://voice.yahoo.com Reply paul ludgate Jan 26, 2007 View Source Hi Jacques, I finally got around to looking at RQPC and I am very impressed though I find it incredibly confusing. Like me, documentation isn't your strongest point. I've been working on a similar idea myself but nowhere near as powerful. Re Tiny launchers:- I see you allow for 1024 CommandLine arguments. RQ_Execute**** can only handle 256 so you can save some DATA space there. That is unless you want me to modify the DLLs. Personally, I'd have thought something like 32 was more than enough. I certainly can't remember ever using more than 8, even in DOS. Keep it up, Paul ____________________________________________________________________________________ Never miss an email again! Yahoo! Toolbar alerts you the instant new Mail arrives. http://tools.search.yahoo.com/toolbar/features/mail/ Reply Jacques Jan 26, 2007 View Source paul ludgate wrote: Hello Paul, Thanks for the moral booster. > I finally got around to looking at RQPC and I am very > impressed though I find it incredibly confusing. RQPC takes me much farer than I expected. At the begining it was only supposed to be an automatic tiny builder with any icon size in the exe and as many commandline as needed. And in fact now it's: - a Tiny Builder/Launcher. just building the launcher with precompiled masm bits and according to the size of the icon to insert. No external compiler required for this, all is built in as resources. - a precompiler (build count, ...) + an inline code 'command line interpretor' ' ''pre cmd tiny con myIcon.Ico in the code is equivalent to a command line RQPC MyCode.Bas Tiny con myIcon.Ico - an Tiny Builder/Launcher in wich you can add functions usable in RapidQ code with function through the Run automated Run Time Linkage and the automatically added YourRqCodeBas.Inc. This recompiles a Launcher for each of your application, this 'launcher' can contain fast functions that can be passed automatically to RapidQ providing a ' ''RQEXPORT declaration is done. Too many things in one code probably and not sufficiently separated in the doc. > Like me, documentation isn't your strongest point. As I wrote to Terry Roo:), I nearly made a overwork breakdown with that @##@#@#@#@ doc :). I wanted it be finished for 1st January. I could argue that my language is french but I guess it will even be harder to write that kind of thing in french (In french, I have no language excuse :). > I've been working on a similar idea myself but nowhere > near as powerful. It'is as powerfull as the compiler you use to create your Tiny 'launcher' is. > Re Tiny launchers:- > I see you allow for 1024 CommandLine arguments. > RQ_Execute**** can only handle 256 so you can save > some DATA space there. Well, with Masm (the root version), these datas are set on BSS section, so they are only allocated at runtime (4096 bytes ???). For GCC, FB and BCC ... I guess they are ??Dynamic too. > That is unless you want me to modify the DLLs. No, no need ! I just set 1024 to fit the maximum size of the command line: 8192 byte ??? IIRC OS dependent too. But maybe you could look/think if this would be possible with non tiny exe. With the RapidQxx.Lib un_UPX ??? As I wrote in the doc, there must be somwhere in the .lib a call top something like RQ_ExecuteMemory and RQ_ExecuteFile ??? Then ... ??? > Personally, I'd have thought something like 32 was > more than enough. I certainly can't remember ever > using more than 8, even in DOS. > Keep it up, Paul Do you think, I could be discouraged and give up ? I am now working on having multiples modules in the main modules. It works, for now, with MASM as root compiler and modules written in Masm, FB and GCC. But there are limitations and I wonder if there is real interest in that. Anyway next will be FB main, GCC main with the other. Then, I'll try to add .lib/.a to main then many .rc ... It will be the sixth day and I'll see that what I have done is good. Then on the 7th day I'll rest. I see things for an eight's, nine's ... day To learn RQPC, one should: - first only use it as a tiny builder compiler RQPC MyCode.Bas MyNice.Ico Tiny con|nocon and forget about MASM, FB, GCC, BCC and the precompiler. - then start to play with the in line precompiler ''pre cmd tiny con nice.Ico all the command line arguments can be set in the code and STAY there. It's a great tool. still forget about MASM, FB, GCC, BCC - then if you know FB, GCC, MASM or BCC, no need to know all of them, only one is enough and FB (close RQ) is very good, start to use it when you need speed. If you dont have a speed issue you dont need them. - maybe later, it will be used to rewrite RapidQ from inside ... All you do in RQPC can be done in an external DLL without RQPC. I'll be glad to answer precise questions on RQPC group ! Who read all this ? And how attentiv ? :) Writing RQPC was/is big pleasure. I would not say the same about the doc (which I need too btw). Jacques Reply johnk20042001 Jan 27, 2007 View Source Show message history Reply Jacques Jan 27, 2007 View Source johnk20042001 wrote: > --- In rapidq@yahoogroups.com, paul ludgate wrote: > (paul has jittery fingers on the send button...) >> Hi Jacques, >> >> I finally got around to looking at RQPC and I am very >> impressed though I find it incredibly confusing. > > I too find it has a lot of steps, maybe you could simply use a > precompiler Directive like $FREEBASIC ... code here... $END_FREEBASIC. > That way you can also check to see all subs/funcs have the 4 parameter > limit ok. > It's in the project: ''pre fb, ''pre asm, ''pre cpp, ''pre bcc with all the ''pre fb enb Is it harder to create a file named MyFb.Fbb and then add it in a ''pre cmd line ? ''pre cmd MyFb.Fbb ''pre because it's the only word that is searched and then faster. If there is no ''pre in the line nothing to do for the precompiler there. Yesterday, 12 hours ago, I replied in this group to Paul, it's not yet in the group ??? Reply Jacques Jan 27, 2007 View Source ------------------------------------------------------- A message of mine, posted later, being already received in the group, I resent this one ! ------------------------------------------------------- paul ludgate wrote: Hello Paul, Thanks for the moral booster. > I finally got around to looking at RQPC and I am very > impressed though I find it incredibly confusing. RQPC takes me much farer than I expected. At the begining it was only supposed to be an automatic tiny builder with any icon size in the exe and as many commandline as needed. And in fact now it's: - a Tiny Builder/Launcher. just building the launcher with precompiled masm bits and according to the size of the icon to insert. No external compiler required for this, all is built in as resources. - a precompiler (build count, ...) + an inline code 'command line interpretor' ' ''pre cmd tiny con myIcon.Ico in the code is equivalent to a command line RQPC MyCode.Bas Tiny con myIcon.Ico - an Tiny Builder/Launcher in wich you can add functions usable in RapidQ code with function through the Run automated Run Time Linkage and the automatically added YourRqCodeBas.Inc. This recompiles a Launcher for each of your application, this 'launcher' can contain fast functions that can be passed automatically to RapidQ providing a ' ''RQEXPORT declaration is done. Too many things in one code probably and not sufficiently separated in the doc. > Like me, documentation isn't your strongest point. As I wrote to Terry Roo:), I nearly made a overwork breakdown with that @##@#@#@#@ doc :). I wanted it be finished for 1st January. I could argue that my language is french but I guess it will even be harder to write that kind of thing in french (In french, I have no language excuse :). > I've been working on a similar idea myself but nowhere > near as powerful. It'is as powerfull as the compiler you use to create your Tiny 'launcher' is. > Re Tiny launchers:- > I see you allow for 1024 CommandLine arguments. > RQ_Execute**** can only handle 256 so you can save > some DATA space there. Well, with Masm (the root version), these datas are set on BSS section, so they are only allocated at runtime (4096 bytes ???). For GCC, FB and BCC ... I guess they are ??Dynamic too. > That is unless you want me to modify the DLLs. No, no need ! I just set 1024 to fit the maximum size of the command line: 8192 byte ??? IIRC OS dependent too. But maybe you could look/think if this would be possible with non tiny exe. With the RapidQxx.Lib un_UPX ??? As I wrote in the doc, there must be somwhere in the .lib a call top something like RQ_ExecuteMemory and RQ_ExecuteFile ??? Then ... ??? > Personally, I'd have thought something like 32 was > more than enough. I certainly can't remember ever > using more than 8, even in DOS. > Keep it up, Paul Do you think, I could be discouraged and give up ? I am now working on having multiples modules in the main modules. It works, for now, with MASM as root compiler and modules written in Masm, FB and GCC. But there are limitations and I wonder if there is real interest in that. Anyway next will be FB main, GCC main with the other. Then, I'll try to add .lib/.a to main then many .rc ... It will be the sixth day and I'll see that what I have done is good. Then on the 7th day I'll rest. I see things for an eight's, nine's ... day To learn RQPC, one should: - first only use it as a tiny builder compiler RQPC MyCode.Bas MyNice.Ico Tiny con|nocon and forget about MASM, FB, GCC, BCC and the precompiler. - then start to play with the in line precompiler ''pre cmd tiny con nice.Ico all the command line arguments can be set in the code and STAY there. It's a great tool. still forget about MASM, FB, GCC, BCC - then if you know FB, GCC, MASM or BCC, no need to know all of them, only one is enough and FB (close RQ) is very good, start to use it when you need speed. If you dont have a speed issue you dont need them. - maybe later, it will be used to rewrite RapidQ from inside ... All you do in RQPC can be done in an external DLL without RQPC. I'll be glad to answer precise questions on RQPC group ! Who read all this ? And how attentiv ? :) Writing RQPC was/is big pleasure. I would not say the same about the doc (which I need too btw). Jacques Reply paul ludgate Jan 29, 2007 View Source Re RQPC A few points:- [1] The CommandLine Handlers are buggy. You don't allow for double or multiple contiguous spaces. You also don't consider TABs as seperators which is allowed. MS cater for it, so I'd go along with them. If it's of any help, I've included a snippet of my code at the end. [2] I,ve found that you can leave all the RegisterClassEx/CreateWindowEx stuff out, though you still need AllocConsole. I expect I'll have to put it all back in if I can figure out what TApplication does to keep the whole thing together. [3] General visual problems with or without console for complex objects, QDirTree being an example. I suspect this is probably related to [2], i.e WndProc (not) talking to WndProc. [4] Good news (I like it), I've found that you can run ByteCode as a Resource. It's a lot easier and neater than the file and heap method. (a) in rsrc.rc -------------- 1 RCDATA "MyProg.bc" (b) in null.asm --------------- invoke FindResource,0,1,RT_RCDATA mov edi,eax invoke SizeofResource,0,edi mov esi,eax ; ByteCodeSize invoke LoadResource,0,edi invoke LockResource,eax ; ByteCodeExecute invoke RQ_ExecuteMemory,eax,esi,ADDR CmdPtr+4,CmdCnt Paul See also: CommandLine Handler below ;*************************************** ; CommandLine Handler ;....................................... invoke GetCommandLine mov esi,eax xor ebx,ebx mov edi,esi xor ecx,ecx mov CmdPtr+4,ebx ;--------------------------------------- CmdLineLoop: mov al,[esi] test al,al jz ZTermFound cmp al,' ' ja @F inc esi jmp CmdLineLoop @@: cmp al,'"' jne CmdUnquoted inc esi mov al,[esi] cmp al,'"' ; check for "" jne CmdQuoted inc esi jmp CmdLineLoop ;--------------------------------------- CmdQuoted: mov [CmdPtr+ecx*4],edi inc ecx CmdQuotedLoop: mov [edi],al inc edi inc esi mov al,[esi] test al,al jz ZTermFound cmp al,'"' jne CmdQuotedLoop mov [edi],bl inc edi inc esi jmp CmdLineLoop ;--------------------------------------- CmdUnquoted: mov [CmdPtr+ecx*4],edi inc ecx CmdUnquotedLoop: mov [edi],al inc edi inc esi mov al,[esi] test al,al jz ZTermFound cmp al,' ' ja CmdUnquotedLoop mov [edi],bl inc edi inc esi jmp CmdLineLoop ;--------------------------------------- ZTermFound: mov [edi],bl dec ecx mov CmdCnt,ecx ;======================================= ;======================================= ____________________________________________________________________________________ Cheap talk? Check out Yahoo! Messenger's low PC-to-Phone call rates. http://voice.yahoo.com Reply Jacques Jan 29, 2007 View Source paul ludgate wrote: > Re RQPC > A few points:- > > [1] The CommandLine Handlers are buggy. > You don't allow for double or multiple contiguous > spaces. You also don't consider TABs as seperators > which is allowed. MS cater for it, so I'd go > along with them. If it's of any help, I've > included a snippet of my code at the end. Yes, it's on the todo list (I ignored about tabs). But it's a hell of a work :) (see below) When one use simple 'main' function one get argc and argv but with 'winmain' you only get the lpCommandLine. There is an API ???GetCLArray??? but it does not work under Win98, so I had to write that code building Argc, Argv. > [2] I,ve found that you can leave all the > RegisterClassEx/CreateWindowEx stuff out, though > you still need AllocConsole. Guessing you were right, I checked. Yes these are useless :) and real burden. Fortunatly, I add the following: ' ' I am not a great window programmer, remarks at ...@... ' in *ALL* the codes containing it, I just checked. I know who I am :) and what I am worth :). Did you read it? It's easy to get rid of these useless lines when an external compiler is used and the 'launcher' is rebuild at RQPC compile, I just have to comment the lines. But for the internal MASM TinyBuilder it's another thing. It's sewed bits, a bit like patches and when the size of a bit changes evertything has to be rebuild(no fun !). Same for the TAB, multi space issue and for the Resource suggestion here below. I'll do that. Maybe you would like to 'work' on that ? (The place where to test that in the Shell_xxx codes.) > I expect I'll have to > put it all back in if I can figure out what > TApplication does to keep the whole thing together. ??? It would be nice to be able to detect in the bytecode if it's a Gui or a Console ? But it's not the end of the world to add 'con' or 'nocon' in Command Line or in a ''pre cmd line. I have another problem with console: c++ printf writes somewhere but not on the expected console :). Very probably a stdout issue ??? I should have used C rather than C++; maybe I'll add plain C one day ? > [3] General visual problems with or without console > for complex objects, QDirTree being an example. > I suspect this is probably related to [2], > i.e WndProc (not) talking to WndProc. I have multiple codes using QDirTree I use on a daily base (Win98), I have noticed nothing (with 107b DLL and RC.EXE). > [4] Good news (I like it), I've found that you can > run ByteCode as a Resource. It's a lot easier > and neater than the file and heap method. > > (a) in rsrc.rc > -------------- > 1 RCDATA "MyProg.bc" > > (b) in null.asm > --------------- > invoke FindResource,0,1,RT_RCDATA > mov edi,eax > invoke SizeofResource,0,edi > mov esi,eax ; ByteCodeSize > invoke LoadResource,0,edi > invoke LockResource,eax ; ByteCodeExecute > invoke RQ_ExecuteMemory,eax,esi,ADDR CmdPtr+4,CmdCnt Yes ! I tried that but never succeeded to have it work. I was wondering: is the appended bytecode loaded in memory when the 'launcher' is loaded? Well this is too the easy solution to optionally include RapidQ32.Dll in the Tiny Executable and Extract it at RunTime to have the Tinyexe a bit more 'stand alone'. Stand alone TinyExe that will be much bigger but with all the RQPC features. All these changes has to be done in one time, not to rebuild the 'bits' 4 or five times. > Paul This was a *great* positiv critic, this will be implemented in the next version. Maybe I'll upload alpha versions, just the .Exe and the 'changed' file. Many thanks Paul, Jacques Reply johnk20042001 Jan 30, 2007 View Source Very interesting work, I look forward to the next release. Reply paul ludgate Jan 30, 2007 View Source --- Jacques wrote: > > (a) in rsrc.rc > > -------------- > > 1 RCDATA "MyProg.bc" > > > > (b) in null.asm > > --------------- > > invoke FindResource,0,1,RT_RCDATA > > mov edi,eax > > invoke SizeofResource,0,edi > > mov esi,eax ; ByteCodeSize > > invoke LoadResource,0,edi > > invoke LockResource,eax ; ByteCodeExecute > > invoke RQ_ExecuteMemory,eax,esi,ADDR > CmdPtr+4,CmdCnt > > Yes ! I tried that but never succeeded to have it > work. I > was wondering: is the appended bytecode loaded in > memory > when the 'launcher' is loaded? > In this case the bytecode is embedded as RCDATA along with the ICON in the RSRC segment. It is not appended. The launcher just finds it and runs it. It works perfectly for me. Don't worry about the CommandLine. I've just uploaded snakedile 1.08 http://www.freewebs.com/snakedile/ Only the DLLs are affected. In order to make it easier to make even smaller launchers I've put a CommandLine Handler into the DLLs. As the DLL is in the same ThreadProcess as the launcher it can invoke GetCommandLine itself. You can still do it the old way if you want to but to get the DLL to do the work for you ... RQ_ExecuteFile (Filename, 0, -1) RQ_ExecuteMemory(MemoryPtr, MemorySize, 0, -1) Now then, how about RQ_ExecuteResource? If they share they share the same ThreadProcess, can a DLL access the launcher's resources while it's running? I don't want it to load from file, that would be pointless. Paul. ____________________________________________________________________________________ Be a PS3 game guru. Get your game face on with the latest PS3 news and previews at Yahoo! Games. http://videogames.yahoo.com/platform?platform=120121 Reply Jacques Jan 30, 2007 View Source paul ludgate wrote: > Don't worry about the CommandLine. > I've just uploaded snakedile 1.08 > > http://www.freewebs.com/snakedile/ Not yet tested but thanks ! (I wrote a new CommandLine handler last night ... useless :). > Only the DLLs are affected. > In order to make it easier to make even smaller > launchers I've put a CommandLine Handler into the > DLLs. As the DLL is in the same ThreadProcess as the > launcher it can invoke GetCommandLine itself. > You can still do it the old way if you want to but to > get the DLL to do the work for you ... > > RQ_ExecuteFile (Filename, 0, -1) > RQ_ExecuteMemory(MemoryPtr, MemorySize, 0, -1) Great ! I suppose your 'commandline handler' can handle any kind of MS CommandLine arguments (multiple spaces, tabs and quoted args). > Now then, how about RQ_ExecuteResource? Sounds good ? Do you have lot of free space in RapidQ32.Dll ? (It will take time for me to implement all this in RQPC. I have MASM, FB, GCC and BCC to update ... the worse is the builtin launcher: the one that requires no external compiler, just able to add any icon size, console/noconsole, encrypt/noencrypt) > If they share the same ThreadProcess, can a DLL access the > launcher's resources while it's running? I guess yes ? Simply:) use api in your patch to get the resource ?handle ? Providing that the resource is loaded at compile time, by a code added to the laucher by the precompiler. *************************************************************** Maybe you did not see yet that from the precompiler your can rewrite the 'launcher' to fill your needs and then recompile it, before to compile the bytecode and rebuild your TinyExecutable. *************************************************************** That's what RQPC does, plus automatic Run Time Linking with RapidQ and this with Masm, GCC, BCC and FreBasic. Maybe that's why the doc is somewhat 'indigeste' :). I realise now that RQPC offers more than what a DLL can offer, it offers full linking (and thus full resource and more). > I don't want it to load from file, that would > be pointless. ????? I lightly tested a code with a QForm.WndProc, it badly crashed. ??? You gave me work for two weeks :) .. at least. Jacques Reply Bob Gee Jan 31, 2007 View Source --- paul ludgate wrote: > I've just uploaded snakedile 1.08 > > http://www.freewebs.com/snakedile/ > > Paul. Paul, just so you know, if no one else has mentioned it. On your page: http://www.freewebs.com/snakedile/rapidqirfanview.htm the link to the download is: http://rqirfanview.zip/ instead of: http://www.freewebs.com/snakedile/rqirfanview.zip And on your page: http://www.freewebs.com/snakedile/embeddingtutorial.htm the link to the download is: http://embeddingtut.zip/ instead of: http://www.freewebs.com/snakedile/embeddingtut.zip I noticed this the first time I visited your site, back when you first put it up. But forgot to mention it to you then. Didn't remember til just now when I revisited to download your new revision. ____________________________________________________________________________________ Need a quick answer? Get one in minutes from people who know. Ask your question on www.Answers.yahoo.com Reply paul ludgate Jan 31, 2007 View Source --- Jacques wrote: > paul ludgate wrote: > > > Don't worry about the CommandLine. > > I've just uploaded snakedile 1.08 > > > > http://www.freewebs.com/snakedile/ > > Not yet tested but thanks ! (I wrote a new > CommandLine > handler last night ... useless :). > > > Only the DLLs are affected. > > In order to make it easier to make even smaller > > launchers I've put a CommandLine Handler into the > > DLLs. As the DLL is in the same ThreadProcess as > the > > launcher it can invoke GetCommandLine itself. > > You can still do it the old way if you want to but > to > > get the DLL to do the work for you ... > > > > RQ_ExecuteFile (Filename, 0, -1) > > RQ_ExecuteMemory(MemoryPtr, MemorySize, 0, -1) > > Great ! I've now uploaded snakedile 1.09 http://www.freewebs.com/snakedile/ Icons: As long the main icon of your Launcher is named MAINICON it will now be inherited by GUI apps. Doing this answered my question about DLLs reading their owner's resources. Of course they can! That's how some dialogs inherit their owner's icon. > I suppose your 'commandline handler' can handle any > kind of > MS CommandLine arguments (multiple spaces, tabs and > quoted args). > I tested it with everything I thought was reasonable but you can never make anything foolproof because fools are so inventive. > > Now then, how about RQ_ExecuteResource? > > Sounds good ? Do you have lot of free space in > RapidQ32.Dll ? There's plenty of space for data as everthing after BSS can easily be moved. I think you can use non-contiguous segments for code but I've yet to test that theory. About the rest of your reply:- I'm not actually using RQPC at all, I'm completely engrossed in improving my own Launchers. But it was RQPC that convinced me to start loving the DLLs in the first place, so thanks and I'll do all I can to help. Paul. ____________________________________________________________________________________ Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/features_spam.html Reply Jacques Jan 31, 2007 View Source paul ludgate wrote: > I've now uploaded snakedile 1.09 > http://www.freewebs.com/snakedile/ > > Icons: > As long the main icon of your Launcher is named > MAINICON it will now be inherited by GUI apps. Great again! Even if I have not *yet* been able to test that. (I am not great at resource but I have a good doc:). What I am great at ? Dont ask). Could you give me the line to write in Masm .Rc file do this? ??? MAINICON ICON "nice.ico" ??? >> I suppose your 'commandline handler' can handle any >> kind of >> MS CommandLine arguments (multiple spaces, tabs and >> quoted args). >> > > I tested it with everything I thought was reasonable > but you can never make anything foolproof because > fools are so inventive. Yes, they even want to add multiple spaces and tabs in command lines :) when my code dont support that. In a previous uploade Masm code, Tab was not implemented. BTW, before to start writing a long MASM basic code, look in the Directory M32LIB of MASM there are lots of goodies there. >>> Now then, how about RQ_ExecuteResource? >> Sounds good ? Do you have lot of free space in >> RapidQ32.Dll ? > > There's plenty of space for data as everthing after > BSS can easily be moved. I think you can use > non-contiguous segments for code but I've yet to test > that theory. If place is missing in DLL, in MASM, you still can create a free space in .data, .code, .data? (=MASM bss) in the launcherand store it's address somewhere that you can get in the DLL: ie use api SetProp and GetProp to pass that address between modules. Hmmmm thinking! From DLL, you could as well allocate memory on the ?process heap? and copy the content of a file or a resource in it? Did you say free space ;). Will this space be a torpedo in RQPC's hull? > About the rest of your reply:- > I'm not actually using RQPC at all, I'm completely > engrossed in improving my own Launchers. I am a bit sad to hear that but I would probably have done the same :). Improving your own launchers: that's the goal of RQPC: add whatever you want to the launcher, in MASM, GCC, BCC and FB. I still wonder if you fully realised that? > But it was RQPC that convinced me to start loving the > DLLs in the first place, so thanks So, I 'engrossed' you? Well, if you have a french dictionnary at hand, look at verb "engrosser" :)! > and I'll do all I can to help. You already did it a big time. With non patched DLL, TINY would have been much much less interesting. Did you investigate the 'form.wndproc' issue (if there is one ? I dont think so). I have a code that bugs, and I am a bit lost with that (see below). Jacques '=========================================================================== ' Subject: ADD ICON TO THE SYSTEM TRAY Date: 12-23-99 (17:55) ' Author: The ABC Programmer Code: RAPIDQ ' Origin: voxel@... Packet: RAPIDQ.ABC '=========================================================================== ' How to put your application icon into the system tray area. ' Double click your icon to "re-display" the application. ' A bit buggy I guess, don't worry if you receive weird errors, just reboot ' your machine. :) Should work fine though... ' Written in Rapid-Q by William Yu $TYPECHECK ON DECLARE SUB Shell_NotifyIcon LIB "SHELL32" ALIAS "Shell_NotifyIconA" _ (dwMessage AS LONG, NIDATA AS QNOTIFYICONDATA) CONST FALSE = 0 CONST TRUE = 1 CONST NIM_ADD = 0 CONST NIM_MODIFY = 1 CONST NIM_DELETE = 2 CONST NIM_MESSAGE = 1 CONST NIM_ICON = 2 CONST NIM_TIP = 4 CONST WM_USER = &H400 CONST WM_TRAYICON = WM_USER + 400 CONST WM_COMMAND = &H111 CONST WM_SYSCOMMAND = &H112 CONST WM_LBUTTONDOWN = &H201 CONST WM_LBUTTONDBLCLK = &H203 CONST WM_RBUTTONDOWN = &H204 CONST WM_RBUTTONDBLCLK = &H206 CONST SC_MINIMIZE = 61472 CONST SC_CLOSE = 61536 DIM Form AS QForm DIM Button AS QButton DIM NI AS QNotifyIconData DIM AlreadyTrayed AS INTEGER AlreadyTrayed = FALSE SUB FormClose Shell_NotifyIcon(NIM_DELETE, NI) '-- Remove our tray icon END SUB SUB ButtonClick IF NOT AlreadyTrayed THEN NI.hWnd = Form.Handle NI.uID = Application.hInstance NI.uFlags = NIM_ICON OR NIM_MESSAGE OR NIM_TIP NI.hIcon = Application.Icon NI.uCallBackMessage = WM_TRAYICON NI.szTip = "Rapid-Q Tray Example" Shell_NotifyIcon(NIM_ADD, NI) END IF Form.Visible = FALSE END SUB SUB FormWndProc (Handle AS INTEGER, uMsg AS DWORD, wParam AS LONG, lParam AS LONG) IF uMsg = WM_SYSCOMMAND THEN 'IF wParam = SC_MINIMIZE THEN ' ButtonClick 'END IF ELSEIF uMsg = WM_TRAYICON THEN IF (lParam AND &HFFFF) = WM_LBUTTONDBLCLK THEN '-- Respond on double click Form.Caption = "I'm back!" Form.Visible = TRUE '-- Bring back our form END IF END IF END SUB Button.Parent = Form Button.Caption = "Tray me" Button.OnClick = ButtonClick Form.Caption = "Tray Example" Form.Center Form.OnClose = FormClose Form.WndProc = FormWndProc Form.ShowModal '=========================================================================== The following is the buggy line, NI.hIcon = Application.Icon the application is minimized in the tray, by there is no icon in the tray (not even the default system or RQ icon) If add the following, $RESOURCE FORM_ICO AS "Boot.Ico" Form.IcoHandle = FORM_ICO ... NI.hIcon = Form.Icon ' rather than NI.hIcon = Application.Icon This make me think that maybe the Application.Icon should be inherrited too ??? For now, I am a bit lost with this? The wndproc seems to work correctly, just add a showmessage to check. --------------- Reply paul ludgate Feb 1, 2007 View Source --- Jacques wrote: > paul ludgate wrote: (edited) > > > I've now uploaded snakedile 1.09 > > http://www.freewebs.com/snakedile/ > > > > Icons: > > As long the main icon of your Launcher is named > > MAINICON it will now be inherited by GUI apps. > > Could you give me the line to write in > Masm .Rc file do this? MAINICON ICON "nice.ico" is correct, see ... http://msdn2.microsoft.com/en-us/library/aa381043.aspx Incidentally, when I set out to make this work I thought I'd be adding functionality. However, once I'd got to the appropriate place in the code I soon realised I was back to fixing bugs. It always was trying to load an icon called MAINICON but it was using it's own hInstance rather than that of the calling thread. > BTW, before to start writing a long MASM basic code, > look in the Directory M32LIB of MASM there are lots > of goodies there. I do use that for inspiration but it sometimes gets a bit too HLL for my liking. Generally, if it's not nice HLL like RQ then give me pure ASM. I tolerate 'invoke' but that's about it. > If place is missing in DLL, in MASM, you still can > create a free space in .data, .code, .data? > (=MASM bss) in the > launcherand store it's address somewhere that you > can get in the DLL: ie use api SetProp and > GetProp to pass that address between modules. The problem is such I'd that have to end up with... MAINCODE (original as per William Yu + my mods) DATA BSS AUXCODE (new routines) IMPORT and so on. I still haven't tested it yet but a while back I read somewhere that you shouldn't do this. I don't know whether they meant it wouldn't work or that I'd be branded a peasant for doing it. > > I'm not actually using RQPC at all, I'm completely > > engrossed in improving my own Launchers. > > I am a bit sad to hear that but I would probably > have done the same :). Improving your own > launchers: that's the goal > of RQPC: add whatever you want to the launcher, in > MASM, GCC, BCC and FB. I still wonder if you fully > realised that? > I have fully realised that and that's what I'm doing myself but not in all those languages as I'm fine with MASM for full PE stuff but still prefer NASM for writing raw BIN for patches. I now have no use for FB because I've learned enough ASM now to write pure ASM DLLs and RQ is still by far the nicest HLL. I'm still very interested in RQPC but it's not quite the way I want to do things but it is similar enough to provide we with ideas from time to time. The only real problem I have with RQPC is the Environment$ stuff - there's got to be a better way. I am also really trying to push my ByteCode as a resource. This way when the EXE is loaded into memory then so is the resource. An appended ByteCode is not and you have to do a seperate fileload in which case you may as well just load the .bc file rather than another copy of the EXE just to copy off the end. I'll get round to adding RQ_ExecuteResource in a day or two and I think you'll see what I mean. Back at the .rc script ... MAINICON ICON "nice.ico" 1 RCDATA "niceProgToo.bc" You could have multiple programs as resources and have the Launcher choose which one to run based on a CommandLine argument. Back there again! Paul. P.S I'll try to have a look at the WnDProc thing, keep me posted. ____________________________________________________________________________________ Expecting? Get great news right away with email Auto-Check. Try the Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html Reply Jacques Feb 1, 2007 View Source paul ludgate wrote: >> paul ludgate wrote: (edited) >> >>> I've now uploaded snakedile 1.09 >>> http://www.freewebs.com/snakedile/ >>> >>> Icons: >>> As long the main icon of your Launcher is named >>> MAINICON it will now be inherited by GUI apps. >> Could you give me the line to write in >> Masm .Rc file do this? > MAINICON ICON "nice.ico" is correct, see ... > http://msdn2.microsoft.com/en-us/library/aa381043.aspx Good link! The problem is to read and learn all that! Yet, resource is a rather easy 'script' thing. I use the MASM RC.HELP (not sure it's from MASM). MAINICON now works with the 4 compilers I use, half an hour work. Here is the FB part (I use QStringlist to create text files ... very easy. slTmp is a QStringList) slTmp.Clear ' slTmp.AddItems ("FB_PROGRAM_ICON ICON \"" & sIcon & "\"") ' repalced by slTmp.AddItems ("MAINICON ICON \"" & sIcon & "\"") BCC already had it; GCC, I replaced 101 by MAINICON; MASM you know. All the compilers seem to know the Word or Constant 'MAINICON'. Is it an MS ???ATOM??? Where do they get it ? See how 'NULL' I am :) >> BTW, before to start writing a long MASM basic code, >> look in the Directory M32LIB of MASM there are lots >> of goodies there. > > I do use that for inspiration but it sometimes gets a > bit too HLL for my liking. Generally, if it's not nice > HLL like RQ then give me pure ASM. I tolerate 'invoke' > but that's about it. That's called 'fanatism' :). When it's about reading command line, a 10 microsecond time loose is not much. Using the MASM Macros makes code much readable, lowers bug probability, decrease code writing time. The price to pay is a code slightly very slower ... but you know that, it is the 'Pandora Box', the 'Ink bottle' of many asm Forums. I dont like Macros either. > The problem is such I'd that have to end up with... > > MAINCODE (original as per William Yu + my mods) > DATA > BSS > AUXCODE (new routines) > IMPORT and so on. That's the PE structure. I vaguely know about that, after BSS, it's 'unchartered territory' (terra incognita) for me. > I still haven't tested it yet but a while back I read > somewhere that you shouldn't do this. > I don't know whether they meant it wouldn't work or > that I'd be branded a peasant for doing it. "To be branded a peasant": not fair. Do you think I could be named like that? :) >> Improving your own launchers: that's the goal >> of RQPC: add whatever you want to the launcher, in >> MASM, GCC, BCC and FB. I still wonder if you fully >> realised that? > I have fully realised that and that's what I'm doing > myself but not in all those languages as I'm fine with > MASM for full PE stuff but still prefer NASM for > writing raw BIN for patches. I started there. Then, it's not bad to import a G++ code or a FreeBasic Library, ... Gcc can compile to BIN too. I should say AS - the GNU assembler - rather than Gcc. And as FreeBasic and GCC can output an AS assembler file, GCC and FreeBasic can produce BIN just like NASM (and probably MASM too?). Gcc optimized Assembler output is a lesson on how to write optimized assembler, I *NEVER* beat it; neither on speed, nore on size. It's like playing chess against a computer. > I now have no use for FB because I've learned enough > ASM now to write pure ASM DLLs and RQ is still by far > the nicest HLL. All the 30 people here will agree. Elsewhere ??? > I'm still very interested in RQPC but it's not > quite the way I want to do things but it is > similar enough to provide we with ideas from > time to time. > The only real problem I have with RQPC is the > Environment$ stuff - there's got to be a better way. When I realized that everything can be linked and the potentialities, I wanted to have it working *NOW*. I choosed that solution because it was easy to implement, allows flexibility and was under my control. Other envisaged solutions were: - passing an array of pointer to the Func/Data - using Api SetProp, GetProp For now about 1000 items can be exported in the 32K BSS buffer. The RTL requires at worth ??5 millisecond, done one time at application start. > I am also really trying to push my ByteCode as a > resource. > This way when the EXE is loaded into memory > then so is the resource. An appended ByteCode is not > and you have to do a seperate fileload in which case > you may as well just load the .bc file rather than > another copy of the EXE just to copy off the end. > I'll get round to adding RQ_ExecuteResource in a > day or two and I think you'll see what I mean. I am waiting that. Yesterday, I lost 3 hours trying to implement RQ_ExecuteMemory(x, y, 0, -1). Cant find the name of the exe file to open. Dont reply to this point, the RQ_ExecuteResource will solve all that. Work, you lazy! Did you hear the whip? > Back at the .rc script ... > MAINICON ICON "nice.ico" > 1 RCDATA "niceProgToo.bc" > You could have multiple programs as resources and have > the Launcher choose which one to run based on a > CommandLine argument. Back there again! Dont forget that resources can too be Loaded in RapidQ code at compile time too, then extracted to QMemoryStream ... Of course not the Main ByteCode, but 'secondary' ones yes. I have examples of ByteCode executed from RapidQ code, just a new form in the process. The tip is not to leave the secondary bytecode with exit process :) (End). > P.S I'll try to have a look at the WnDProc thing, keep > me posted. I think there is no problem with WndProc, the example I pasted yesterday is a good test. A good test for the MAINICON code too. In RQ32_109.Dll Application.Icon and Form.Icon are set to MAINICON. There must be a MS internal inheritance from Application to Form ???? Pfewwwwwwwwwwwww (Ouf! here) Jacques Reply Terry Feb 2, 2007 View Source Jacques you said:- To learn RQPC, one should: - first only use it as a tiny builder compiler RQPC MyCode.Bas MyNice.Ico Tiny con|nocon and forget about MASM, FB, GCC, BCC and the precompiler. So I unzipped the file into a RQPC folder. I created a bat file with the command:- RQPC Myfile.exe MyIcon.ico Initially I got an error about not having RapidQ32.dll(as I do not have it in windows path) I supplied the dll and on retry I get the error "Cannot load EXE file" I would like to get my teeth into this but I am having difficulty swallowing the first bite. I am starting to see the implications of your work but I need a starting point. Your grasshopper. Reply Jacques Feb 2, 2007 View Source Terry wrote: > Jacques you said:- > To learn RQPC, one should: > > - first only use it as a tiny builder compiler > > RQPC MyCode.Bas MyNice.Ico Tiny con|nocon > > and forget about MASM, FB, GCC, BCC and the precompiler. > > So I unzipped the file into a RQPC folder. > > I created a bat file with the command:- > > RQPC Myfile.exe MyIcon.ico MyFile.Bas not MyFile.Exe (as written above :) (RQPC compiles RapidQ code, did you edit RQPC.INI and check that the RapidQ Directories are OK for your computer ? [RQPC] RQ_ROOT_DIR=c:\Rapid-Q\ RQ_LIBS_DIR=c:\Rapid-Q\Libs RQ_INC_DIR=c:\Rapid-Q\Includes) > Initially I got an error about not having RapidQ32.dll(as I do not > have it in windows path) > I supplied the dll and on retry I get the error > "Cannot load EXE file" I am a bit confused with your attempt to compile an exe? But I guess it's a error in this message only. So, it maybe a Directory issue ??? I cant reproduce your error ? > "Cannot load EXE file" This happens after RapidQ compilation when RQPC runs the compiled code and load the executable to extract the bytecode. Strange, it runs like a char here under Win98 and XP. Tell me more. Jacques Reply Terry Feb 2, 2007 View Source It could be a directory thing. I tend to place projects into a seperate directory. There is nothing wrong with your code and program. No I did not edit the RQPC.ini file. Will do. One of my failings. Yes I do have a couple. Is that often when I get a new appliance I push all the buttons to see what ticks. That I am afraid follows on to software.Now where did I unzipped that file. You remind me of a brilliant guy I knew at work. Walked and talked Access. Terrible coffee though. Reply Terry Feb 2, 2007 View Source --- In rapidq@yahoogroups.com, Jacques wrote: > Tell me more. > > Jacques Coulden't resist This is my path as I have edited RQPC.ini [RQPC] RQ_ROOT_DIR=C:\Program files\RQBasic\ RQ_LIBS_DIR==C:\Program files\RQBasic\Lib RQ_INC_DIR==C:\Program files\RQBasic\Include MASM32_ROOT_DIR=c:\Masm32\' >>>I left this FB_ROOT_DIR=c:\FreeBasic\ FB_LIB_DIR=c:\FreeBasic\Lib FB_INC_DIR=c:\FreeBasic\Inc GCC_BIN_DIR=c:\MinGw\Bin\' >>>and this DEFAULT_PATHFILE_ICON= Message >>Still Cannot load exe My Batch file: RQPC Myfile.exe MyIcon.ico Files I am working on are in E:\RQPC\RQPC as unzipped Its possible my installation of RQ files may not be the same as yours Reply Jacques Feb 2, 2007 View Source Terry wrote: I never tried it on a non C drive! I should be ashame to say that, I am a little bit. Everything, on both computers where I tested it here, is on C:. Up to now, I found a directory issue when using MASM external compiler from a different drive (in MASM: include \masm32\include\windows.inc fails if ml.exe is called from another drive), but this is *NOT* your case. I quickly tried with your configuration: RQPC on E: and your.Bas code on C: , it works here. RQPC should have compiled your EXE ? Did you find the compiled .Exe in the the directory of your code ? Hold on, for a day or two ... ----------------------------- I quickly reply not to let you search uselessly. > It could be a directory thing. I tend to place projects into a > seperate directory. It may be a cross drive issue too ??? > There is nothing wrong with your code and program. No I did not edit > the RQPC.ini file. Will do. > One of my failings. Yes I do have a couple. Is that often when I get a > new appliance I push all the buttons to see what ticks. That I am > afraid follows on to software. Now where did I unzipped that file. > You remind me of a brilliant guy I knew at work. Walked and talked > Access. Terrible coffee though. Thanks for being my tester! Maybe the only user :) ? Please apology for your lost time. =================================================================== >> Tell me more. >> > > Coulden't resist > > This is my path as I have edited RQPC.ini > [RQPC] > RQ_ROOT_DIR=C:\Program files\RQBasic\ > RQ_LIBS_DIR==C:\Program files\RQBasic\Lib > RQ_INC_DIR==C:\Program files\RQBasic\Include > MASM32_ROOT_DIR=c:\Masm32\' >>>I left this > FB_ROOT_DIR=c:\FreeBasic\ > FB_LIB_DIR=c:\FreeBasic\Lib > FB_INC_DIR=c:\FreeBasic\Inc > GCC_BIN_DIR=c:\MinGw\Bin\' >>>and this > DEFAULT_PATHFILE_ICON= If you dont use an External compiler (you dont), MASM, FB, BCC and GCC directories are not necessary (if they are, it's a bug :). > Message >>Still Cannot load exe > My Batch file: RQPC Myfile.exe MyIcon.ico Here you go again! You dont pass the MyFile.Exe to RQPC but MyFile.Bas: RQPC MyFile.Bas MyIcon.Ico (but you must pass it correctly, whether you'll get a different error) > Files I am working on are in E:\RQPC\RQPC as unzipped > Its possible my installation of RQ files may not be the > same as yours This is ??theorically supported. Jacques NB: please post your next message on RQPC group, this group is invaded by RQPC issues, it's not it's goal. Reply Terry Message 24 of 24 , Feb 3, 2007 View Source I will continue on RQPC forum and thanks for your patience Terry